import { PartialType, ApiProperty } from '@nestjs/swagger'
import { CreateWorkDto } from './create-wall.dto'
import { IsArray, IsEnum, IsInt, IsOptional } from 'class-validator'
import { Type } from 'class-transformer'
import { WorkStatus } from '../entities/wall.entity'

export class UpdateWorkDto extends PartialType(CreateWorkDto) {}

export class UpdateWorkStatusDto {
  @ApiProperty({ description: '作品状态：0-普通，1-冠军', enum: WorkStatus })
  @IsEnum(WorkStatus, { message: '无效的作品状态' })
  @IsOptional()
  status?: WorkStatus;
}

export class BatchUpdateWorkStatusDto {
  @ApiProperty({ description: '作品ID列表', type: [Number], example: [1, 2, 3] })
  @IsArray()
  @IsInt({ each: true })
  @Type(() => Number)
  ids: number[];
}

// 旧的UpdateWallDto保留，防止引用它的代码报错
export class UpdateWallDto {}
